<div class="modal-dialog" role="document">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="exampleModalLabel">用户信息</h4>
        </div>
        <form style="padding:4%;height:410px;overflow-y:auto;" id="addTeamForm" data-toggle="validator" role="form">
            <input type="hidden" value="{$teamId}" name="team_id" />
            <input type="hidden" value="{$userInfo.id}" name="id" />
        	<div class="row">
        		<div class="form-group col-sm-6">
	                <label class="control-label">姓名<span style="color:red;">*</span></label>
	                <input type="text" class="form-control" name="real_name"  value="{$userInfo.real_name}" placeholder="请填写姓名" data-error="姓名为必填项!" required>
        		</div>
        		<div class="form-group col-sm-6">
	                <label class="control-label">身份证号</label>
	                <input type="text" class="form-control" name="identity"  value="{$userInfo.identity}" placeholder="请填写身份证号"  >
                        <div class="help-block with-errors"></div>
        		</div>
        		<div class="form-group col-sm-6">
	                <label class="control-label">手机号<span style="color:red;">*</span></label>
	                <input type="tel" class="form-control" name="mobile"  value="{$userInfo.mobile}" placeholder="请填写手机号" data-error="手机号为必填项!" required>

        		</div>
        		<div class="form-group col-sm-6">
	                <label class="control-label">邮箱</label>
	                <input type="text" class="form-control" name="email"  value="{$userInfo.email}" placeholder="请填写邮箱">
                        <div class="help-block with-errors"></div>
        		</div>
        		<div class="form-group col-sm-6">
	                <label class="control-label">职务</label>
	                <input type="text" class="form-control" name="position"  value="{$userInfo.position}" placeholder="请填写职务">
                        <div class="help-block with-errors"></div>
        		</div>
        		<div class="form-group col-sm-6">
                            <label class="control-label">管理平台角色</label>
                            <div class="checkbox" style="padding-left: 20px;">
                                <input <if condition="!empty($userInfo['adminInfo'])" >checked="checked"</if> value="1" name="teamAdmin" type="checkbox"> 团队管理员
                            </div>
                        <div class="help-block with-errors"></div>
        		</div>
        		<div class="form-group col-sm-12">
	                <label class="control-label">备注</label>
                        <textarea rows="4" class="form-control" name="{$userInfo.remark}" cols="200" placeholder="200字以内"></textarea>
        		</div>
        	</div>
        </form>
        <div class="modal-footer">
            <button type="button" data-dismiss="modal" class="btn btn-default">取消</button>
            <button type="button" id="saveTeam" class="btn btn-primary">保存</button>
        </div>
    </div>
</div>
<script type="text/javascript" src="__PUBLIC__/js/select2/select2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/validator.min.js"></script>
<script>
    
   $("#addTeamForm").validator();


    $("#saveTeam").click(function () {
        var validator = $("#addTeamForm").data("bs.validator");
        validator.validate();
        if(!validator.hasErrors()){
            $.ajax({
                url: "{:U('Admin/Space/Settled/doSaveTeamUser')}",
                type: "post",
                dataType: "json",
                data: $("#addTeamForm").serialize(),
                success: function (data) {
                    if(data){
                        $("#commonModal").modal('toggle');
                        common.alert("提示", "团队成员添加成功!", function () {
                            common.reload();
                        });
                    }else{
                        common.alert("提示", "团队成员添加失败!")
                    }
                }
            })
        }
    })
    
</script>